package com.brucekong.slm.service.system;

import com.brucekong.slm.mapper.system.RoleMapper;
import com.brucekong.slm.model.system.RoleDomain;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RoleService {

    @Resource
    private RoleMapper roleMapper;

    public PageInfo<RoleDomain> getRoles(int page, int limit) {

        PageHelper.startPage(page, limit);
        List<RoleDomain> roleDomains = roleMapper.getRoles(page, limit);
        return new PageInfo<>(roleDomains);
    }
}
